Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

Description

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@chris-ashe chris-ashe self-assigned this Dec 18, 2025
@chris-ashe chris-ashe added Bug TF Coil Toroidal field coil labels Dec 18, 2025
@chris-ashe chris-ashe linked an issue Dec 18, 2025 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.06%. Comparing base (2f754a2) to head (0b1e28f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
process/superconducting_tf_coil.py 81.25% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4018      +/-   ##
==========================================
- Coverage   45.88%   44.06%   -1.82%     
==========================================
  Files         123      123              
  Lines       29087    30955    +1868     
==========================================
+ Hits        13346    13641     +295     
- Misses      15741    17314    +1573     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@je-cook je-cook added Bug Something isnt working and removed Bug labels Jan 5, 2026
Copy link
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to think about this and test it a bit more. This doesn't fix the problem, but I am not so sure there is a solution: we are at a garbage point in the parameter space where a positive solution does not exist.

This PR will stop PROCESS from crashing and instead it will (probably) fail to converge.

The only thing I need to convince myself of is that -1 is an acceptable fallback. Could this -1 end up in the availability model or a constraint, cause that model to be wrong, but we somehow converge?

Copy link
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still thinking so no rush with these changes. I think this mixture of local/global is redundant and might even cause the two to be different at points in the execution.

full_output=True,
disp=True,
)
temp_tf_superconductor_margin = -1.0e0 # Default value in case of exception
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
temp_tf_superconductor_margin = -1.0e0 # Default value in case of exception

Remove this default and use the variable tfcoil_variables.temp_margin, I think having the local variable is redundant

logger.error(
"""Negative TFC temperature margin
f"""Negative TFC temperature margin
temp_tf_superconductor_margin: {temp_tf_superconductor_margin}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
temp_tf_superconductor_margin: {temp_tf_superconductor_margin}
temp_tf_superconductor_margin: {tfcoil_variables.temp_margin}

temp_tf_superconductor_margin = t_zero_margin - temp_tf_coolant_peak_field
tfcoil_variables.temp_margin = temp_tf_superconductor_margin

if temp_tf_superconductor_margin <= 0.0e0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if temp_tf_superconductor_margin <= 0.0e0:
if tfcoil_variables.temp_margin <= 0.0e0:

"""
)

return temp_tf_superconductor_margin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return tfcoil_variables.temp_margin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isnt working TF Coil Toroidal field coil

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newton solve crashing when calculating t_zero_margin

5 participants